<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-cn" xml:lang="zh-cn">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="DC.Type" content="topic">
  <meta name="DC.Title" content="管理快照">
  <meta name="DC.Format" content="XHTML">
  <meta name="DC.Identifier" content="ZH-CN_TOPIC_0000002024918278">
  <meta name="DC.Language" content="zh-cn">
  <link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
  <title>管理快照</title>
 </head>
 <body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px">
  <a name="ZH-CN_TOPIC_0000002024918278"></a><a name="ZH-CN_TOPIC_0000002024918278"></a>
  <h1 class="topictitle1">管理快照</h1>
  <div>
   <div class="section">
    <h4 class="sectiontitle">现象描述</h4>
    <p>快照功能开启失败。</p>
   </div>
   <div class="section">
    <h4 class="sectiontitle">可能原因</h4>
    <p>执行快照功能开启的目录中可能存在已开启快照功能的子目录。</p>
   </div>
   <div class="section">
    <h4 class="sectiontitle">处理步骤</h4>
    <ol>
     <li><span>执行前使用puTTY，以root用户登录HDFS数据库代理主机。</span></li>
     <li><span>执行环境变量。</span><p></p><pre class="screen">source<em>安装目录</em>/bigdata_env</pre> <p></p></li>
     <li><span>执行下面命令切换为HDFS数据库用户。</span><p></p><pre class="screen">kinit <em>HDFS数据库用户</em></pre>
      <div class="fignone">
       <span class="figcap"><b>图1 </b>登录HDFS数据库用户</span><br><span><img src="zh-cn_image_0000002062302697.png"></span>
      </div> <p></p></li>
     <li><span>执行以下命令进行快照的管理。</span><p></p>
      <ul>
       <li>查询目录下的所有快照。<pre class="screen">hdfsdfs -ls <em>目录</em>.snapshot</pre>
        <div class="fignone">
         <span class="figcap"><b>图2 </b>查询根目录（/）下的所有快照</span><br><span><img src="zh-cn_image_0000002062230577.png"></span>
        </div></li>
      </ul>
      <ul>
       <li>删除目录下的快照。<pre class="screen">hdf sdfs -deleteSnapshot <em>目录</em> <em>快照名称</em></pre>
        <div class="fignone">
         <span class="figcap"><b>图3 </b>删除根目录（/）下的快照</span><br><span><img src="zh-cn_image_0000002062092889.png"></span>
        </div></li>
      </ul>
      <ul>
       <li>查询系统中开启快照的目录以及该目录的权限。<pre class="screen">hdfs lsSnapshottableDir</pre>
        <div class="fignone">
         <span class="figcap"><b>图4 </b>查询系统中开启快照的目录以及该目录的权限</span><br><span><img src="zh-cn_image_0000002062264957.png"></span>
        </div></li>
      </ul>
      <ul>
       <li>关闭目录的快照功能。<pre class="screen">hdfs dfsadmin -disallowSnapshot <em>目录</em></pre>
        <div class="fignone">
         <span class="figcap"><b>图5 </b>关闭根目录（/）的快照功能</span><br><span><img src="zh-cn_image_0000002062289265.png"></span>
        </div>
        <div class="note">
         <img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span>
         <div class="notebody">
          <p>关闭目录的快照功能前，必须删除目录里的所有快照。</p>
         </div>
        </div></li>
      </ul> <p></p></li>
    </ol>
   </div>
  </div>
 </body>
</html>